from flask import Flask, redirect, url_for
from flask_sqlalchemy import SQLAlchemy

app = Flask(__name__)
app.config['SECRET_KEY'] = "mysecretkey"
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///bs.db'
db = SQLAlchemy(app)

# 注册蓝图

with app.app_context():
    from blueprints.auth.api import User
    from blueprints.personal.api.information import PersonalInformation
    from blueprints.personal.api.identity import PersonalIdentity
    db.create_all()


from blueprints import blueprint_register
blueprint_register(app)

# 确保在应用上下文中创建表


@app.route('/')
def hello_world():
    return redirect(url_for('auth.login'))

if __name__ == '__main__':
    app.run()